Skip to content

K8SPSMDB-1660 use pull_request_target to allow labeling PRs from forks#2359

Merged
hors merged 3 commits into
mainfrom
K8SPSMDB-1660
Jun 3, 2026
Merged

K8SPSMDB-1660 use pull_request_target to allow labeling PRs from forks#2359
hors merged 3 commits into
mainfrom
K8SPSMDB-1660

Conversation

@hors

@hors hors commented May 26, 2026

Copy link
Copy Markdown
Collaborator

CHANGE DESCRIPTION

Problem:
The pull_request event runs with read-only GITHUB_TOKEN for fork PRs, causing "Resource not accessible by integration" when trying to set labels. Switching to pull_request_target runs the workflow in the base repo context with full write permissions.
Also pin actions/checkout and actions/labeler to full commit SHAs.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

The pull_request event runs with read-only GITHUB_TOKEN for fork PRs,
causing "Resource not accessible by integration" when trying to set
labels. Switching to pull_request_target runs the workflow in the base
repo context with full write permissions.
Also pin actions/checkout and actions/labeler to full commit SHAs.
Copilot AI review requested due to automatic review settings May 26, 2026 08:57
@pull-request-size pull-request-size Bot added the size/XS 0-9 lines label May 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the PR labeling GitHub Actions workflow so it can apply labels on pull requests opened from forks by switching the trigger from pull_request to pull_request_target (so the workflow runs in the base-repo context with write permissions).

Changes:

  • Switch workflow trigger from pull_request to pull_request_target for PR open/synchronize events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hors hors merged commit 21d1773 into main Jun 3, 2026
14 checks passed
@hors hors deleted the K8SPSMDB-1660 branch June 3, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS 0-9 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants